<template>
  <div class="main-header">
    <div class="main-header-background"></div>
    <div class="main-header-user-info overall-flex">
      <avatar edit :size="90" :src="userInfo.avatar" hoverEdit></avatar>

      <div class="header-base">
        <div class="header-base-top"></div>
        <div class="header-base-bottom overall-flex">
          <div class="header-base-bottom-left">
            <p class="header-base-bottom-left-username">
              {{ userInfo.username }}
            </p>
            <p class="header-base-bottom-gray">{{ userInfo.username }}</p>
          </div>
          <div class="header-base-bottom-right">
            <p class="header-base-bottom-left-username">
              {{ userInfo.username }}
            </p>
            <p class="header-base-bottom-gray">{{ userInfo.username }}</p>
          </div>
        </div>
      </div>

      <div class="header-option"></div>

      <div class="header-operate">
        <i class="overall-icon header-operate-icon icon-gengduo"></i>
      </div>
    </div>
  </div>
</template>

<script>
import avatar from "~/avatar/avatar.vue";
export default {
  components: { avatar },
  props: ["userInfo"],
};
</script>

<style lang="scss" scoped>
$mainHeaderHeight: 260px;
$backgroundHeight: 140px;
$top: 65px;
.main-header {
  height: $mainHeaderHeight;
  background: white;
  margin-bottom: 24px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0px 3px 7px 1px #e1d6d669;

  &-user-info {
    position: absolute;
    top: calc(#{$backgroundHeight} - #{$top});
    left: 0px;
    width: 100%;
    height: calc(#{$mainHeaderHeight} - calc(#{$backgroundHeight} - #{$top}));
    // background: rgba(187, 82, 82, 0.74);
    padding: 30px 50px;
    box-sizing: border-box;
  }

  &-background {
    border-radius: 12px;
    width: 98%;
    margin: 0 auto;
    margin-top: 10px;
    background: url("https://imgb15.photophoto.cn/20201210/qiyeziyuanguihuatupian-40094697_3.jpg");
    height: $backgroundHeight;
    filter: blur(0px);
    box-shadow: inset 0px -17px 13px -7px rgba(253, 253, 253, 0.1),
      // inset 0px -17px 13px -7px rgba(253,253,253,.11),
      // inset 0px -17px 13px -7px rgba(253,253,253,.12)
;
  }
}

.header-base {
  height: 600px;
  margin-left: 25px;
  display: flex;
  flex-direction: column;

  &-top {
    height: calc(#{$top} - 20px);
    font-size: 1.1rem;
    color: black;
    padding-top: 20px;
    font-weight: bold;
  }
  &-bottom {
    flex: 1;
    font-size: 1.2rem;
    gap: 28px;
    &-left {
      &-username {
        font-size: 1.2rem;
        margin-bottom: 10px;
      }
    }

    &-gray {
      color: gray;
    }
  }
}
.header-option {
  flex: 1;
}
.header-operate {
  $width:30px;
  position: absolute;
  right: 12px;
  top: calc(#{$top} + (#{$width} - 10px));
  width: $width;
  height: $width;
  background: rgba(172, 158, 158, 0.199);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  transition: 260ms all linear;
  box-shadow:  0px 3px 7px 1px #e1d6d669;
  border:1px solid #c3c3c344;
  &:hover{
    color: orangered;
    border-color: orangered;
  }
}
</style>
